import React from 'react';
import { connect } from 'react-redux';
import BaseComponent from '../../components/common/baseComponent';
import { getQueryParam } from '../../utils/url';

import icon201606051 from '../../../assets/images/guide/20190605/1.jpg';
import icon201606052 from '../../../assets/images/guide/20190605/2.jpg';
import icon201606053 from '../../../assets/images/guide/20190605/3.jpg';
import icon201606054 from '../../../assets/images/guide/20190605/4.jpg';
import icon201606055 from '../../../assets/images/guide/20190605/5.jpg';
import icon201606056 from '../../../assets/images/guide/20190605/6.jpg';
import icon201606057 from '../../../assets/images/guide/20190605/7.jpg';
import icon201606058 from '../../../assets/images/guide/20190605/8.jpg';

@connect()
class Guide extends BaseComponent {
  getPic = (name) => {
    let icon;
    switch (name) {
      case '201606051':
        icon = icon201606051;
        break;
      case '201606052':
        icon = icon201606052;
        break;
      case '201606053':
        icon = icon201606053;
        break;
      case '201606054':
        icon = icon201606054;
        break;
      case '201606055':
        icon = icon201606055;
        break;
      case '201606056':
        icon = icon201606056;
        break;
      case '201606057':
        icon = icon201606057;
        break;
      case '201606058':
        icon = icon201606058;
        break;
      default:
        break;
    }
    return icon;
  }
  render() {
    const pic = getQueryParam('pic');
    let icon;
    if (pic.startsWith('http')) {
      icon = pic;
    } else {
      icon = this.getPic(pic);
    }
    return (
      <div className="guide">
        <img src={icon} alt="" />
      </div>
    );
  }
}

export default Guide;
